<?php
/**
 * $Id: contact.php 378 2009-11-10 07:31:57Z shrey $
 * 
 * This file can not be redistributed to anyone without the permission of Giga Promoters
 * Copyright 2005 - 2008, Giga Promoters
 * 						  608 Aggarwal Cyber Plaza
 *						  Netaji Subhash Place, Delhi - 110034
 *						  www.gigapromoters.com
 * 
  * This is parent of parent class of a controller and should not be edited ever without permission.
 * @version 			$Rev: 378 $
 * @lastModifiedBy		$LastChangedBy: varun $
 * @lastChanged			$Date: 2010-09-09 23:31:57 -0800 (Wed, 09 Sep 2010) $
 * @copyright 			Giga Promoters (www.gigapromoters.com)
 * 
 */

class AbstractContact extends CmsAppModel
{
	var $name = 'Contact';
	var $useTable = false;
	var $_schema = array(
		'name'		=>array('type'=>'string', 'length'=>100), 
		'company'		=>array('type'=>'string', 'length'=>100), 
		'address'	=>array('type'=>'text'),
		'city'		=>array('type'=>'string', 'length'=>100), 
		'pincode'		=>array('type'=>'string', 'length'=>100), 
		'country'		=>array('type'=>'string', 'length'=>100), 
		'telephone'		=>array('type'=>'string', 'length'=>10), 
		'email'		=>array('type'=>'string', 'length'=>255), 
		'message'	=>array('type'=>'text'),
		'captcha' => array('type'=>'string', 'length'=>20),
		);

	var $validate = array(
		'name' => array(
			'required' => true,	
			'rule'=>VALID_NOT_EMPTY, 
			'message'=>'Name is required'),
	
		'address' => array(
			'rule'=>VALID_NOT_EMPTY, 
			'message'=>'Address is required'),
	
		'city' => array(
			'rule'=>VALID_NOT_EMPTY, 
			'message'=>'City is required'),
	
		'country' => array(
			'required' => true,		
			'rule'=>VALID_NOT_EMPTY, 
			'message'=>'Country is required'),
	
		'email' => array(
			array(
				'required' => true,
				'rule'=>VALID_NOT_EMPTY, 
				'message'=>'Must be a valid email address'
				),
			array(
				'rule'=>'email', 
				'message'=>'Must be a valid email address'
				)
			),
			
		'message' => array(
			'required' => true,	
			'rule'=>VALID_NOT_EMPTY, 
			'message'=>'Message is required')
	);
		
	var $fieldProperties = array(
			'name' =>array(
				'type'=>'text',
				'group'=>'contact'
				),
			'email' =>array(
				'type'=>'text',
				'group'=>'contact'
				),
			'country'=>array(
				'type'=>'countrySuggestor',
				'group'=>'contact'
				),
			'city' =>array(
				'type'=>'text',
				'group'=>'contact'
				),
			'address'=>array(
				'type'=>'textarea',
				'group'=>'contact'
				),
			'pincode'=>array(
				'type'=>'text',
				'group'=>'contact'
				),
			'message'=>array(
				'type'=>'textarea',
				'group'=>'contact'
				),
			'captcha'=>array(
				'type'=>'captcha',
				'group'=>'contact'
				)
			);
	
}
//end of class
?>